package com.sky.controller.user;

import com.sky.result.Result;
import com.sky.service.CategoryService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@Slf4j
@RestController("userCategoryController")
@RequestMapping("/user/category")
@Api(tags = "C端分类接口")
public class CategoryController {
    @Autowired
    private CategoryService categoryService;

    @GetMapping("/list")
    @ApiOperation("(根据分类)查询菜品或者套餐")
    public Result list(Integer  type) {
        log.info("查询分类数据，type:{}", type);
        return Result.success(categoryService.list(type));
    }
}
